import { extendSchemas } from '@/components/cms/utils'
import type { ComponentsConfig, ComponentsConfigRaw } from '../../types'
import { videoList } from './simples'
import advsConfig from './base/advs'

const basePath = 'template.videoMore'
const config: ComponentsConfig = {
  title: '视频列表组件设置',
  default: 'videoList',
  components: extendSchemas<ComponentsConfigRaw>(
    {
      videoList: videoList({
        pageFields: {
          background: `${basePath}.background`
        },
        fields: {
          background: `${basePath}.content.videoGrid.background`,
          title: {
            color: `${basePath}.content.videoGrid.title.color`,
            size: `${basePath}.content.videoGrid.title.size`,
            letterSpacing: `${basePath}.content.videoGrid.title.letterSpacing`,
            lineHeight: `${basePath}.content.videoGrid.title.lineHeight`
          },
          layout: {
            style: `${basePath}.content.videoGrid.layout.style`,
            limit: `${basePath}.content.videoGrid.layout.limit`
          }
        }
      })
    },
    advsConfig(['playerBeforeAdv', 'playerPauseAdv'])
  )
}

export default config
